import React, { VFC } from "react"
import { Table, TablePaginationConfig } from 'antd';

const TableList:VFC<any> = (props?:any) => {
    const { dataSource, columns, pagination, onChange, loading } = props
    const onTableChange = (page: TablePaginationConfig) => {
        onChange(page)
    }
    return (
        <Table 
            rowKey={({i})=> i}
            bordered
            columns={columns} 
            dataSource={dataSource}
            onChange={onTableChange}
            pagination={pagination}
            loading={loading}
            scroll={{ x: 0, y: 530 }}
       />
    )
}
export default TableList